<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="/static/include/head.jsp" %>
<script type="text/javascript" src="${path }/static/js/product/typeParams.js"></script>
</head>

<body>
<!-- <div class="modal-content"> -->
    <div class="modal-header">
        <button class="close" type="button" data-dismiss="modal">×</button>
        <h4 class="modal-title" id="viewModalLabel">修改（${type.name }）参数</h4>
    </div>
    <div class="modal-body">
    	<form method="post" action="${path }/product/goodsType/saveTypeParams" id="paramsForm">
			<input type="hidden" name="paramnum" id="paramnum" />

			<div style="width: 100%; text-align: left">
				<ul class="list-unstyled">
					<li><a href="javascript:;" id="paramAddBtn">新增参数组</a></li>
				</ul>
			</div>

			<div id="param_div">
			<!-- foreach paramGroups -->
			<c:forEach items="${paramGroups }" var="group">
			<table class="table table-bordered table-condensed no-footer">
			<tbody>
				<tr class="group" style="background-color: #DDEEF2;">
					<td><label class="">参数组名</label></td>
					<td class="col-xs-7">
						<input type="text" class="form-control" name="groupnames" maxlength="60" value="${group.name }" />
					</td>
					<td>
						<span>
							<a href="javascript:;" class="sysbtn addBtn">新增参数</a>
							<a href="javascript:;" class="delete"><span class="glyphicon glyphicon-trash"></span></a>
						</span>
					</td>
				</tr>
				<!-- foreach paramList -->
				<c:forEach items="${group.paramList }" var="para">
				<tr class="param">
					<td><label class=" pull-right">参数名</label></td>
					<td  class="col-xs-7">
						<input type="text" name="paramnames" class="form-control" value="${para.name }" />
					</td>
					<td>&nbsp;
					<a href="javascript:;" class="delete">
						<span class="glyphicon glyphicon-trash"></span></a>
					</td>
				</tr>
				</c:forEach>
			</tbody>
			</table>
			</c:forEach>
			<!-- end foreach paramGroups -->
			</div>
			<input type="hidden" name="id" value="${param.id}">
		</form>
    </div>
    <div class="modal-footer">
    	<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary" onclick="doSubmit();">提交更改</button>
    </div>
<!--  </div> -->
 <!-- template -->
 <table class="table table-bordered table-condensed no-footer" id="paramTemplate" style="display:none;">
	<tbody>
	     <tr class="group"  style="background-color:#DDEEF2;">
	       <td><label class="">参数组名</label></td>
	       <td class="col-xs-7">
	       <input type="text" class="form-control" name="groupnames"  maxlength="60" value=""/>
	       </td>
	       <td>
	       <span>
				<a href="javascript:;" class="sysbtn addBtn">新增参数</a>
				<a href="javascript:;" class="delete"><span class="glyphicon glyphicon-trash"></span></a>
			</span>
	       </td>
	     </tr>
	       
	     <tr class="param">
	       <td><label class=" pull-right">参数名</label></td>
	       <td  class="col-xs-7">
				<input type="text" name="paramnames" class="form-control" value="" />
			</td>
	       <td>&nbsp;
	       		<a href="javascript:;"  class="delete"><span class="glyphicon glyphicon-trash"></span></a></a>
	       </td>
	     </tr>
	</tbody>
</table>
</body>
</html>